package cn.tedu.csmall.product.pojo.param;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 添加类别的参数类
 */

@Data
public class CategoryAddNewParam implements Serializable {
    @NotNull(message = "添加分类失败，必须提交分类名称")
    @ApiModelProperty(value = "分类名称", required = true)
    private String name;

    @Range(min = 1)
    @ApiModelProperty(value = "上级ID", required = true)
    private Long parentId;
    private String keywords;

    @NotNull(message = "添加分类失败，必须提交排序序号！")
    @Range(max = 99, message = "添加分类失败，排序序号值必须0~99之间！")
    @ApiModelProperty(value = "排序序号,0~99之间数字", required = true)
    private Integer sort;

    private String icon;

    @Range(max = 1, message = "添加分类失败，授权号值必须0~1之间！")
    @ApiModelProperty(value = "授权号,0~1之间数字", required = true)
    private Integer enable;

    @Range(max = 1, message = "添加分类失败，授权号值必须0~1之间！")
    @ApiModelProperty(value = "显示授权,0~1之间数字", required = true)
    private Integer isDisplay;

}
